import {Modal} from "antd";
import {FC, PropsWithChildren,memo} from "react";

const EditModal: FC<
  PropsWithChildren<{
    isModalOpen?: boolean;
    title?: string;
    onCancel?: () => void;
    onOk?: () => void;
    width?:number;
  }>
> = ({ width = 500,title, children, isModalOpen, onCancel, onOk }) => {
  return (
    <Modal
      open={isModalOpen}
      onOk={onOk}
      onCancel={onCancel}
      title={title}
      cancelText={'取消'}
      okText={'确认'}
      width={width}
      destroyOnClose
      footer={null}
    >
      {children}
    </Modal>
  );
};

export default memo(EditModal)